<?php
/* @var $this SiteController */
/* @var $model LoginForm */
/* @var $form CActiveForm  */

$this->pageTitle=Yii::app()->name . ' - Login';
$this->breadcrumbs=array(
	'Đăng ký tài khoản',
);
Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl.'/assets/datetimepicker/jquery.datetimepicker.css');
Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl.'/assets/datetimepicker/jquery.datetimepicker.js');
$model->unsetAttributes(array(
   'Password',
   'Birthday',
   'repeatPassword',
));
?>
<div class="container">
   <div class="top"></div>
   <div class="form">
   <?php $form=$this->beginWidget('CActiveForm', array(
   	'id'=>'register-form',
      'action' => '/dang-ky', 
   	'enableClientValidation'=>true,
   	'clientOptions'=>array(
   		'validateOnSubmit'=>true,
   	),
      'htmlOptions' => array(
         'class' => 'user-form',
      )
   )); ?>
   <div class="caption relative text-center">
      <em class="arrow half-arrow-down sprite absolute medium-left"></em>
      <i class="sprite icon-key absolute"></i>
      <span class="font-opensans bold">Đăng ký</span>
      <i class="sprite icon-user absolute"></i>
      <em class="arrow half-arrow-down sprite absolute medium-right"></em>
   </div>
   <div class="control-container">
         <?php 
            if(Yii::app()->user->hasFlash('error')){
               echo Str::notificationBox('error',Yii::app()->user->getFlash('error'),'Lỗi');
            }
            if(Yii::app()->user->hasFlash('success')){
               echo Str::notificationBox('success',Yii::app()->user->getFlash('success'),'Thông báo');
            }
         ?>
         <p class="note">Những dòng đánh dấu <span class="required">*</span> là bắt buộc.</p>
         <div class="row">
      		<?php echo $form->labelEx($model,'MemberName'); ?>
      		<?php echo $form->error($model,'MemberName'); ?>
            <?php echo $form->textField($model,'MemberName'); ?>
      		
      	</div>
         
         <div class="row">
      		<?php echo $form->labelEx($model,'LoginName'); ?>
      		<?php echo $form->error($model,'LoginName'); ?>
            <?php echo $form->textField($model,'LoginName'); ?>
      		
      	</div>
         
      	<div class="row">
      		<?php echo $form->labelEx($model,'Password'); ?>
      		<?php echo $form->error($model,'Password'); ?>
            <?php echo $form->passwordField($model,'Password'); ?>
      	</div>
         
         <div class="row">
      		<?php echo $form->labelEx($model,'repeatPassword'); ?>
      		<?php echo $form->error($model,'repeatPassword'); ?>
            <?php echo $form->passwordField($model,'repeatPassword'); ?>
      	</div>
      
         <div class="row">
      		<?php echo $form->labelEx($model,'Email'); ?>
      		<?php echo $form->error($model,'Email'); ?>
            <?php echo $form->textField($model,'Email'); ?>
      	</div>
         <div class="row">
      		<?php echo $form->labelEx($model,'Birthday'); ?>
      		<?php echo $form->error($model,'Birthday'); ?>
            <?php echo $form->textField($model,'Birthday',array('class' => 'datepicker')); ?>
      	</div>
         <div class="row radio-group">
      		<?php echo $form->labelEx($model,'Gender'); ?>
      		<?php echo $form->error($model,'Gender'); ?>
            <?php $model->Gender = 1?>
            <?php echo $form->radioButtonList($model,'Gender',array(1=>'Nam',0=>'Nữ'), array('separator' => '',/* 'onchange' => 'menuTypeChange(this.value);'*/)); ?>
      	</div>
         <div class="row">
      		<?php echo $form->labelEx($model,'Mobile'); ?>
      		<?php echo $form->error($model,'Mobile'); ?>
            <?php echo $form->textField($model,'Mobile'); ?>
      		
      	</div>
      
         <div class="row text-center">
            <?php echo CHtml::submitButton('Đăng ký',array('class' => 'btn btn-info'))?>
            <?php echo CHtml::button('Hủy',array('class' => 'btn btn-warning','onclick' => 'window.history.go(-1)'))?>
      	</div>
   </div>
   <?php $this->endWidget(); ?>   
   </div><!-- form -->
</div>
<script>
   $(document).ready(function(){
      $(".datepicker").datetimepicker({
         format:'d/m/Y',
         timepicker:false,
      });
   });
</script>
